package com.storeapp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.storeapp.dao.MyCustomerDao;
import com.storeapp.entity.domain.MyCustomer;

@Component
@Transactional
public class MycustomerService {
	@Autowired
	private MyCustomerDao myCustomerDao;
	
	@Transactional(readOnly = true)
	public MyCustomer getMyCustomer(Long id) {
		return myCustomerDao.get(id);
	}

	public void saveOrUpdateMycustomer(MyCustomer entity) {
		myCustomerDao.save(entity);
	}
	
	public void deleteMycustomer(MyCustomer entity) {
		myCustomerDao.delete(entity);
	}

	public List<MyCustomer> listAll() {
		return myCustomerDao.getAll();
	}
}
